/*
 * @Description: 入口
 * @Author: wangqi
 * @Date: 2021-05-04 22:22:31
 * @LastEditTime: 2021-05-08 11:18:23
 */

import parseTemplateToTokens from './parseTemplateToTokens';
import renderTemplate from './renderTemplate';

window.WQ_TemplateEngine = {
    render(templateStr, data) {
        // 让模板字符串变成嵌套的tokens 数组
        let tokens = parseTemplateToTokens(templateStr);
        // 让tokens变成DOM字符串
        let domStr = renderTemplate(tokens, data);
        return domStr;
    }
}


